package com.example.mobile2021606128wengje0324;

import androidx.appcompat.app.AppCompatActivity;
import androidx.appcompat.view.menu.ShowableListMenu;
import androidx.core.app.NotificationCompatSideChannelService;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        EditText edt_main_account = findViewById(R.id.edt_main_account);
        EditText edt_original_psw = findViewById(R.id.edt_original_psw);
        EditText edt_new_psw = findViewById(R.id.edt_new_psw);
        EditText edt_new_psw2 = findViewById(R.id.edt_new_psw2);
        Button btn_01 = findViewById(R.id.btn_01);
        btn_01.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                String str = edt_main_account.getText().toString();
                String str1 = edt_original_psw.getText().toString();
                String str2 = edt_new_psw.getText().toString();
                String str3 = edt_new_psw2.getText().toString();

                if (str1.equals("abc123")) {
                    if (str2.equals(str3)) {
                        Toast.makeText(MainActivity.this, "修改成功",Toast.LENGTH_SHORT).show();
                    } else {
                        edt_new_psw2.setText("两次密码不一致，请重新输入");

                    }
                }else{
                    edt_original_psw.setText("原密码错误");
                }
            }
        });







    }
}

